library("tidyverse")
library("firatheme")
library("prediction")
library("estimatr")
library("sandwich")
library("lmtest")
library("texreg")

# load data
load("~/df_replication.RData")

# Table SI 11
model1 <- glm(click ~ cue, family=binomial(link='logit'), data = df_replication)
summary(model1)
vcov1 <- vcovHC(model1, type = "HC2")
coeftest(model1, vcov. = vcov1)
texreg(model1, digits = 3, include.ci = FALSE)


# Table SI 12
model2 <- glm(click ~ issue, family=binomial(link='logit'), data = df_replication)
summary(model2)
vcov2 <- vcovHC(model2, type = "HC2")
coeftest(model2, vcov. = vcov2)
texreg(model2, digits = 3, include.ci = FALSE)

# Table SI 13
model5 <- glm(click ~ cue + issue + region + party_name, family=binomial(link='logit'), data = df_replication)
summary(model5)
vcov5 <- vcovHC(model5, type = "HC2")
coeftest(model5, vcov. = vcov5)
texreg(model5, digits = 3, include.ci = FALSE)

# Table SI 14
model6 <- glm(click ~ cue*issue + region + party_name,  family=binomial(link='logit'), data = df_replication)
summary(model6)
vcov6 <- vcovHC(model6, type = "HC2")
coeftest(model6, vcov. = vcov6)
texreg(model6, digits = 3, include.ci = FALSE)
